package com.xyz.dao.mapper;


import com.xyz.dao.pojo.PlanCalendarVo;
import com.xyz.entity.pojo.EquipmentPlanTemplate;
import com.xyz.entity.pojo.PlanInfo;
import com.xyz.entity.pojo.TemplatePlanPart;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository("templatePlanDao")
public interface TemplatePlanDaoMapper {

        void insertPlanTaskList(@Param("taskIdList") List<Long> taskIdList,@Param("templateId")Long templateId) throws Exception;

        void insertPlanPartList(@Param("templatePlanPartList") List<TemplatePlanPart> templatePlanPartList) throws Exception;

        void insertEquipmentTemplateList(@Param("equipmentTemplateList") List<EquipmentPlanTemplate> equipmentTemplateList) throws Exception;

        void insertPlanInfoList(@Param("planInfoList") List<PlanInfo> planInfoList);

        List<Map<String,Object>> selectEquipmentTemplateByEmIdOne(@Param("emId")Long emId);

        List<Map<String,Object>> selectEquipmentTemplateByEmIdTwo(@Param("emId")Long emId);

        List<Map<String,Object>> selectTemplatePlanTaskByTempId(@Param("templateId")Long templateId);

        List<Map<String,Object>> selectTemplatePlanPartByTempId(@Param("templateId")Long templateId);

        List<PlanCalendarVo> selectPlanInfoByYear(@Param("emIds") List<Long> emIds, @Param("year") int year, @Param("planType") int planType);

        List<Map<String, Object>> selectPlanTemplateByDate(@Param("emTreeList") List<Long> emTreeList,
                                                           @Param("planType") Integer planType,
                                                           @Param("emName") String emName,
                                                           @Param("templateId") Long templateId,
                                                           @Param("businessType") Integer businessType,
                                                           @Param("startTime") Date startTime,
                                                           @Param("endTime") Date endTime);

        List<Map<String, Object>> selectPlanTemplateByDay(@Param("emTreeList") List<Long> emTreeList,
                                                           @Param("planType") Integer planType,
                                                           @Param("emName") String emName,
                                                           @Param("templateId") Long templateId,
                                                           @Param("businessType") Integer businessType,
                                                           @Param("changeTime") Date changeTime);

        List<Map<String, Object>> selectPlanTemplateByDateGroup(@Param("emTreeList") List<Long> emTreeList,
                                                                @Param("planType") Integer planType,
                                                                @Param("startTime") Date startTime,
                                                                @Param("endTime") Date endTime);

        List<Map<String, Object>> selectPlanTemplateByDayGroup(@Param("emTreeList") List<Long> emTreeList,
                                                               @Param("planType") Integer planType,
                                                               @Param("changeTime") Date changeTime);
}
